﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Booky.DataStorage
{   
    //[DataContract(IsReference=true)]
    public class BookmarkGroup
    {
        //[DataMember]
        public int ID { get; set; }

        //[DataMember]
        public string Description { get; set; }
        
        //[DataMember]
        public List<Bookmark> Bookmarks { get; set; }

        //[DataMember]
        public int UserId { get; set; }

        public BookmarkGroup() { }

        public BookmarkGroup(string description, int userId)
        {
            Description = description;
            UserId = userId;
        }

        #region object overrides
        public override bool Equals(object obj)
        {
            if (obj is BookmarkGroup)
            {
                BookmarkGroup compareTo = (BookmarkGroup)obj;
                return compareTo.ID == this.ID;
            }
            else
            {
                return base.Equals(obj);
            }
        }

        public override string ToString()
        {
            return this.Description;
        }
        public override int GetHashCode()
        {
            return this.ID.GetHashCode();
        }
        #endregion

    }
}
